package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.request.SpuPageReq;
import com.lanchetech.bean.response.SpuResp;
import com.lanchetech.bean.vo.ShopVO;
import com.lanchetech.bean.vo.TenantInfoVO;
import com.lanchetech.entity.Shop;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ShopMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Shop record);

    int insertSelective(Shop record);

    Shop selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Shop record);

    int updateByPrimaryKey(Shop record);

    int updateBatch(List<Shop> list);

    int updateBatchSelective(List<Shop> list);

    int batchInsert(@Param("list") List<Shop> list);

    List<Shop> findAllNearbyPage(PageReq req);

    List<Shop> findAllPage(PageReq req);

    Shop findOneByUserId(@Param("userId") Long userId);

    int updateUserIdById(@Param("updatedUserId") Long updatedUserId, @Param("id") Long id);

    int updateDeletedAndUserIdById(@Param("updatedDeleted") Byte updatedDeleted, @Param("updatedUserId") Long updatedUserId, @Param("id") Long id);

    List<Shop> findAllByIds(@Param("ids") List<Long> ids);

    Shop findOneByShopNameLike(@Param("likeShopName") String likeShopName);

    Shop findOneByUserIdAndDeleted(@Param("userId") Long userId, @Param("deleted") Byte deleted);

    Long countByIndustryFirstIdAndOverallStar(@Param("industryFirstId") Long industryFirstId, @Param("overallStar") BigDecimal overallStar);

    Shop findOneByPhone(@Param("phone") String phone);

    TenantInfoVO getTenantInfoById(Long tenantId);

    int updateImageUrlById(@Param("updatedImageUrl") String updatedImageUrl, @Param("id") Long id);

    int updateDescriptionById(@Param("updatedDescription") String updatedDescription, @Param("id") Long id);

    List<Shop> findAll();

    int updateAvatarById(@Param("updatedAvatar") String updatedAvatar, @Param("id") Long id);

    int updateShopNameById(@Param("updatedShopName") String updatedShopName, @Param("id") Long id);

    int updateAfterSaleAddressById(@Param("updatedAfterSaleAddress") String updatedAfterSaleAddress, @Param("id") Long id);

    int updateAfterSalePhoneById(@Param("updatedAfterSalePhone") String updatedAfterSalePhone, @Param("id") Long id);

    int updateReturnAddressById(@Param("updatedReturnAddress") String updatedReturnAddress, @Param("id") Long id);

    int updateServiceRateById(@Param("updatedServiceRate") BigDecimal updatedServiceRate, @Param("id") Long id);

    List<Long> findAllShopIds();

    int updateMallUserIdById(@Param("updatedMallUserId") Long updatedMallUserId, @Param("id") Long id);

    int updateImageListById(@Param("updatedImageList") String updatedImageList, @Param("id") Long id);

    List<ShopVO> findAllBySetIds(@Param("ids") Set<Long> ids);

    ShopVO findOneById(Long tenantId);

    void verify(@Param("id") Long id,@Param("verify") boolean verify);

    /**
     * 获取店铺首页商品分页
     * @param req
     * @return
     */
    List<SpuResp> getSpuHomePage(@Param("req") SpuPageReq req);
}